<?php

header("Content-type: text/html; charset=utf-8");

$sfz=$_GET['sfzh'];
$code=$_GET['code'];
//echo $code;die;
       $cookieFile = dirname(__FILE__).'/'.'cookie.tmp';
       //$data="zkzh=".$_GET['zkzh']."&sfzh=".$_GET['sfzh']."&checkcode=".$_GET['code']."&submit=%B2%E9%D1%AF";
       $data="a_name=$sfz&a_verifycode=$code&Submit=%B2%E9%D1%AF";
       $ch = curl_init();
       curl_setopt($ch, CURLOPT_URL,'http://121.33.188.45:8098/logincheck.asp'); //地址
       curl_setopt($ch, CURLOPT_POST, 1); 
       curl_setopt($ch, CURLOPT_COOKIEFILE,$cookieFile);
       curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 
       curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
       curl_setopt($ch, CURLOPT_HEADER, 0); 
       //curl_setopt($ch, CURLOPT_COOKIEJAR,  $cookieFile);
       curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
       $table=curl_exec($ch); 
	   $tab=mb_convert_encoding($table, "utf-8", "gb2312");
	//echo $table;
	   curl_close($ch);
          $tab=get_td_array($tab);
	   //print_r($tab);











       function get_td_array($table) {
        $table = preg_replace("/<table[^>]*?>/is","",$table);
        $table = preg_replace("/<tr[^>]*?>/si","",$table);
        $table = preg_replace("/<td[^>]*?>/si","",$table);
        $table = str_replace("</tr>","{tr}",$table);
        $table = str_replace("</td>","{td}",$table);
        $table = preg_replace("'<[/!]*?[^<>]*?>'si","",$table);
        $table = preg_replace("'([rn])[s]+'","",$table);
        $table = str_replace(" ","",$table);
        $table = str_replace(" ","",$table);
        $table = str_replace("&nbsp;","",$table);

        $table = explode('{tr}', $table);
        array_pop($table);
        foreach ($table as $key=>$tr) {
            $td = explode('{td}', $tr);
            $td = explode('{td}', $tr);

            array_pop($td);
            $td_array[] = $td;
        }
        array_shift($td_array);
        return $td_array;
    }
?>



<!DOCTYPE html>
<html>
  <head>
    <title>找回准考证</title>
    <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">



<link rel="stylesheet" href="css/weui.min.css">
<link rel="stylesheet" href="css/jquery-weui.css">
<link rel="stylesheet" href="css/demos.css">
<style>
#userimg img{border-radius:55px} 
</style>


  </head>

  <body ontouchstart>


    <header class='demos-header'>
      <h1 class="demos-title">计算机二级</h1>
    </header>
    
  
   
    <div id="userimg" align="center">                                    
        <img src="images/a.jpg" width="100px" height="100px" >
     </div>
<br/>
    <div class="weui-form-preview">
  
  <div class="weui-form-preview__bd">
    <div class="weui-form-preview__item">
      <label class="weui-form-preview__label">姓名</label>
      <span class="weui-form-preview__value"><?php echo $tab[13][1]; ?></span>
    </div>
    <div class="weui-form-preview__item">
      <label class="weui-form-preview__label">准考证号</label>
      <span class="weui-form-preview__value"><?php echo $tab[13][0]; ?></span>
    </div>
    <div class="weui-form-preview__item">
      <label class="weui-form-preview__label">身份证号</label>
      <span class="weui-form-preview__value"><?php echo $tab[13][2]; ?></span>
    </div>
    <div class="weui-form-preview__item">
      <label class="weui-form-preview__label">报考科目</label>
      <span class="weui-form-preview__value"><?php echo $tab[13][3];  ?></span>
    </div>
    <div class="weui-form-preview__item">
      <label class="weui-form-preview__label">等第</label>
      <span class="weui-form-preview__value"><?php echo $tab[13][5];  ?></span>
    </div>
  </div>
 
</div>
   



    

   
   

   
    

   
    
    

    



    <script src="js/jquery-2.1.4.js"></script>
<script src="js/fastclick.js"></script>
<script>
  $(function() {
    FastClick.attach(document.body);
  });
</script>
<script src="js/jquery-weui.js"></script>

  </body>
</html>
